﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UpDeKT.ascx.cs" Inherits="TDT_Project.Controller.UpDeKT" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../css/Telerik.css" rel="stylesheet" type="text/css" />
    <%--<link rel="stylesheet" type="text/css" href="../css/style.css">--%>
</head>

<asp:UpdatePanel ID="Up1" runat="server">
   <ContentTemplate>
<style type="text/css">
    .style3
    {
        color:Blue;
        
    }
    .Chu
    {
        font-weight:bold;
        font-family:Times New Roman;
    }
     .rgAltRow td
            {
                border: 1px solid #96CAFF !important;
            }
            .gridTelerikChuan .rgSelectedRow
            {
                background: #999 !important;
                color: #fff;
            }
            .gridTelerikChuan .rgSelectedRow input[type="text"].riDisabled
            {
                color: #fff;
            }
            .gridTelerikChuan .rgSelectedRow td
            {
                background: #999 !important;
            }
            .gridWiewHeader
            {
                background-color: #2D79F8 !important;
                padding: 0 !important;
            }
            .rgHeader gridWiewHeader
            {
                padding: 0 !important;
            }
</style>
<p></p>
   <h4 class="style3">Tải đáp án để kiểm tra</h4>
   <hr  style="border:1px thin"/>
   
<div style="padding-left:20px;padding-top:20px;" >   
        <table cellpadding="5px" cellspacing="5px">
            <tr>
            <td class="Chu">Niên học:</td>
            <td>
                        <telerik:RadComboBox ID="cbo_nienhoc" runat="server" DropDownWidth="200px" 
                            Skin="Vista" Width="200px"                             
                            AutoPostBack="false" >
                        </telerik:RadComboBox>
            </td>
            <td class="Chu">Khối:</td>
            <td>
                        <telerik:RadComboBox ID="cbo_Khoi" runat="server" DropDownWidth="200px" 
                            Skin="Vista" Width="200px"                             
                            AutoPostBack="false" >
                        </telerik:RadComboBox>
            </td>
             <td class="Chu">Môn học:</td>
            <td>
                        <telerik:RadComboBox ID="cbo_monhoc" runat="server" DropDownWidth="230px" 
                            Skin="Vista" Width="230px"                             
                            AutoPostBack="false" >
                        </telerik:RadComboBox>
            </td>
            </tr>
            <tr>
            <td class="Chu">Tiêu đề:<span style="color:Red">*</span></td>
             <td colspan="5">
              <telerik:RadTextBox ID="txttieude" runat="server" Width="770px" EnableSingleInputRendering="false"
                            MaxLength="1000" AutoCompleteType="Disabled" 
                           EnableTheming="True" CssClass="RadTextboxWhite"
                            >
                        </telerik:RadTextBox>
                        <telerik:RadTextBox ID="txtID" runat="server" Width="1px"
                            AutoCompleteType="Disabled" 
                           EnableTheming="True" CssClass="RadTextboxWhite"
                           Visible="false"
                            >
                        </telerik:RadTextBox>
             </td>
               
            </tr>
            <tr>
            <td class="Chu" valign="top">Nội dung:<span style="color:Red">*</span></td>
             <td colspan="5">
             <%-- <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="~/fckeditor/" Height="400px"
                Width="800px">
            </FCKeditorV2:FCKeditor>--%>
                 <telerik:RadEditor ID="RadEditor1" Runat="server"
                           Skin="Vista"
                           EnableResize="false"
                           EditModes="Design"
                           Width="770px" Height="500px"
                           ToolsFile="~/DefaultToolsFile/ToolsFile.xml"
                 >
                 </telerik:RadEditor>
             </td>
               
            </tr>
             <tr>
            <td class="Chu" valign="top">File đính kèm:
            </td>
             <td colspan="5">
           
                 <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" 
                     Skin="Office2010Blue"
                     MultipleFileSelection="Disabled"
                     MaxFileSize="1000000"
                     AllowedFileExtensions=".doc,.docx,.xls,.xlsx,.pdf"
                     MaxFileInputsCount="1"
                     >
                 </telerik:RadAsyncUpload>
                 </td>
               
            </tr>
            <tr>
            <td colspan="6" align="center">
              <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                            <ContentTemplate>    
            <telerik:RadButton runat="server" ValidationGroup="p" ID="btn_them" CssClass="RadButton"
                            ButtonType="ToggleButton" HoveredCssClass="RadButtonHover" 
                           Text="Thêm mới" Skin="Telerik" Width="105px" Height="30px" onclick="btn_them_Click"
                          
                            >
                            </telerik:RadButton>
                            <telerik:RadButton runat="server" ValidationGroup="p" ID="btn_luu" CssClass="RadButton"
                            ButtonType="ToggleButton" HoveredCssClass="RadButtonHover" 
                           Text="Lưu" Skin="Telerik" Width="105px" Height="30px" onclick="btn_luu_Click"
                         
                            >
                            </telerik:RadButton>
                            <telerik:RadButton runat="server" ValidationGroup="p" ID="btn_tim" CssClass="RadButton"
                            ButtonType="ToggleButton" HoveredCssClass="RadButtonHover" 
                           Text="Tìm kiếm" Skin="Telerik" Width="105px" Height="30px" onclick="btn_tim_Click" 
                           
                            >
                            </telerik:RadButton>
                             </ContentTemplate>
                            <Triggers>
                            </Triggers>
                        </asp:UpdatePanel>
            </td>
            </tr>
            
           <tr>
           <td colspan="6">
           <telerik:RadGrid ID="rid_KT" runat="server" AutoGenerateColumns="False" 
                PageSize="50" HeaderStyle-CssClass="gridWiewHeader" PagerStyle-HorizontalAlign="Right"
                AlternatingRowStyle-CssClass="alt" PagerStyle-CssClass="gridWiewPaging" CellSpacing="0"
                GridLines="None" onitemcommand="rid_KT_ItemCommand">
                <HeaderStyle CssClass="gridWiewHeader" />
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                 <ClientSettings>
                                <Selecting AllowRowSelect="false" />
                                <Scrolling AllowScroll="True" ScrollHeight="200" UseStaticHeaders="True" SaveScrollPosition="True"  />
                            </ClientSettings>
                <MasterTableView NoMasterRecordsText="Không tìm thấy dữ liệu." DataKeyNames="ID"
                    TableLayout="Fixed">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="STT" ItemStyle-HorizontalAlign="Center"
                            HeaderStyle-HorizontalAlign="Center" HeaderText="STT" UniqueName="STT"
                            ReadOnly="True" HeaderStyle-Width="30">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>  
                         <telerik:GridBoundColumn DataField="TenNienHoc" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Niên học" UniqueName="TenNienHoc" ReadOnly="True" HeaderStyle-Width="50">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>   
                         <telerik:GridBoundColumn DataField="ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="ID" UniqueName="ID" ReadOnly="True" HeaderStyle-Width="50" Display="false">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>   
                          <telerik:GridBoundColumn DataField="NienHoc_ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="NienHoc_ID" UniqueName="NienHoc_ID" ReadOnly="True" HeaderStyle-Width="50" Display="false">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>   
                          <telerik:GridBoundColumn DataField="Khoi_ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Khoi_ID" UniqueName="Khoi_ID" ReadOnly="True" HeaderStyle-Width="50" Display="false">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>   
                          <telerik:GridBoundColumn DataField="Mon_ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Mon_ID" UniqueName="Mon_ID" ReadOnly="True" HeaderStyle-Width="50" Display="false">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>   
                        <telerik:GridBoundColumn DataField="TenKhoi" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Khối" UniqueName="TenKhoi" ReadOnly="True" HeaderStyle-Width="40">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>     
                        <telerik:GridBoundColumn DataField="TenMonHoc" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Môn" UniqueName="TenMonHoc" ReadOnly="True" HeaderStyle-Width="100">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>         
                         <telerik:GridBoundColumn DataField="TieuDe" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Tiêu đề" UniqueName="TieuDe" ReadOnly="True" HeaderStyle-Width="150">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>  
                         <telerik:GridBoundColumn DataField="FileURL" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="FileURL" UniqueName="FileURL" ReadOnly="True" HeaderStyle-Width="50">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn> 
                         <telerik:GridBoundColumn DataField="NoiDung" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="NoiDung" UniqueName="NoiDung" ReadOnly="True" HeaderStyle-Width="50" Visible="false">
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>  
                        <telerik:GridTemplateColumn DataField="NgayDang" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
                            HeaderText="Ngày đăng" UniqueName="NgayDang" ReadOnly="True" HeaderStyle-Width="110" DataType="System.DateTime">
                            <ItemTemplate>
                                            <%# String.Format("{0:dd/MM/yyyy hh:mm:ss}", Eval("NgayDang"))%>
                             </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            
                        </telerik:GridTemplateColumn>

                      <%--  <telerik:GridButtonColumn ItemStyle-Width="10" UniqueName="Delete"     
                                 ConfirmDialogType="RadWindow"
                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" 
                               
                                HeaderStyle-Width="20px"
                           
                                    > 
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridButtonColumn>   
                    <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" ItemStyle-Width="10px"                     
                        HeaderStyle-Width="20px">

                    </telerik:GridEditCommandColumn>     --%>
                    <telerik:GridTemplateColumn HeaderText="Sửa" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditItem" CssClass="btnEdit"  Width='19px' Height='19px' CommandArgument='<%# Eval("ID") %>'
                                            CommandName="EditItem" runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Xóa" HeaderButtonType="TextButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Button ID="lnkEditDel" CssClass="btnX"  Width='19px' Height='19px' CommandArgument='<%# Eval("ID") %>' OnClientClick="javascript:return confirm('Bạn có chắc muốn xóa tin này không?');"
                                            CommandName="EditDelItem" runat="server"></asp:Button>
                                    </ItemTemplate>
                                    <HeaderStyle Width="30px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>

                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="false" />
                     <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
             </td>
            </tr>
        </table>
</div>

   </ContentTemplate>
    <Triggers>
       <%-- <asp:PostBackTrigger ControlID="btn_xuat" />--%>
    </Triggers>
   </asp:UpdatePanel>
   <script language="javascript" type="text/javascript">

       function OnClientClicked(button, args) {

           var txttieude = $find('<%= txttieude.ClientID %>');

           var tieude = txttieude.get_textBoxValue();
           if (tieude = '') {
               window.alert('Hãy nhập tiêu đề');
           }
           var txtnd = $find('<%= RadEditor1.ClientID %>');

           var nd = txtnd.get_Value();
           if (nd = '') {
               window.alert('Hãy nội dung');
           }
         
    }
    </script>